<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateTableBroadcast extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function up()
    {
        $this->execute("CREATE TABLE `f_broadcast` (
            `id` INT NOT NULL,
            `msg_id` VARCHAR(45) NULL,
            `media_id` VARCHAR(45) NULL,
            `to` VARCHAR(45) NULL,
            `scope` VARCHAR(45) NULL COMMENT '发送范围',
            `create_time` INT(11) NULL,
            `update_time` INT(11) NULL,
            `author_id` INT NULL,
            PRIMARY KEY (`id`));");
    }
    public function down() 
    {
        $this->execute("drop table `f_broadcast`;");
    }
}
